#!/bin/bash

echo "设置环境变量..."

# OpenGL设置
export PYOPENGL_PLATFORM=osmesa
export MESA_GL_VERSION_OVERRIDE=3.3
export MESA_GLSL_VERSION_OVERRIDE=330
export LIBGL_ALWAYS_SOFTWARE=1

# CUDA库路径设置
export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$CONDA_PREFIX/lib:$LD_LIBRARY_PATH

echo "当前库路径: $LD_LIBRARY_PATH"
echo "检查CUDA库..."
ls /usr/lib/wsl/lib/ | grep cuda | head -3
ls $CONDA_PREFIX/lib/ | grep cuda | head -3

echo "运行FrankMoCap..."
xvfb-run -a -s "-screen 0 1024x768x24" python -m demo.demo_frankmocap \
    --input_path ./test/py.mp4 \
    --out_dir ./mocap_output \
    --save_pred_pkl \
    --save_mesh \
    --use_smplx

echo "完成!"
EOF
